import 'package:finance_app/generated/json/base/json_field.dart';

class ProductsServicesEntity {
  int line;

  @JSONField(name: "Track Inventory *")
  String trackInventory;

  @JSONField(name: "Type*")
  String typeStar;

  @JSONField(name: "SKU / Code")
  String skuCode;

  @JSONField(name: "Name*")
  String name;

  @JSONField(name: "UOM*")
  String uomStar;

  @JSONField(name: "Category")
  int category;
  @JSONField(name: "Average stock cost *")
  num averageStockCost;
  @JSONField(name: "Currency*")
  String currencyStar;
  @JSONField(name: "Opening Stock Balance*")
  num openingStockBalance;
  @JSONField(name: "Sale Price +")
  num salePrice;
  @JSONField(name: "Sale Currency")
  String saleCurrency;
  @JSONField(name: "Sale GST")
  String saleGst;
  @JSONField(name: "Sale Inclusive GST")
  String saleInclusiveGst;
  @JSONField(name: "Buy Price +")
  num buyPrice;

  @JSONField(name: "Buy Currency")
  String buyCurrency;
  @JSONField(name: "Buy GST")
  String buyGst;

  @JSONField(name: "Buy Inclusive GST")
  String buyInclusiveGst;

  String default_currency_inventory_amount;

  ProductsServicesEntity(
      {this.line,
      this.trackInventory,
      this.typeStar,
      this.skuCode,
      this.name,
      this.uomStar,
      this.category,
      this.averageStockCost,
      this.currencyStar,
      this.openingStockBalance,
      this.saleCurrency,
      this.saleGst,
      this.saleInclusiveGst,
      this.buyPrice,
      this.buyCurrency,
      this.default_currency_inventory_amount,
      this.buyGst,
      this.buyInclusiveGst,
      salePrice});

  factory ProductsServicesEntity.fromJson(Map<String, dynamic> json) {
    return ProductsServicesEntity(
      trackInventory: json['Track Inventory *'],
      typeStar: json['Type*'],
      skuCode: json['SKU / Code'],
      name: json['Name*'],
      uomStar: json['UOM*'],
      category: json['Category'],
      averageStockCost: json['Average stock cost *'],
      currencyStar: json['Currency*'],
      openingStockBalance: json['Opening Stock Balance*'],
      salePrice: json['Sale Price +'],
      saleCurrency: json['Sale Currency'],
      saleGst: json['Sale GST'],
      saleInclusiveGst: json['Sale Inclusive GST'],
      buyPrice: json['Buy Price +'],
      line: json['line'],
      buyCurrency: json['Buy Currency'],
      buyGst: json['Buy GST'],
      buyInclusiveGst: json['Buy Inclusive GST'],
      default_currency_inventory_amount:
          json['default_currency_inventory_amount'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['Track Inventory *'] = this.trackInventory;
    data['Type*'] = this.typeStar;
    data['SKU / Code'] = this.skuCode;
    data['Name*'] = this.name;
    data['UOM*'] = this.uomStar;
    data['Category'] = this.category;
    data['Average stock cost *'] = this.averageStockCost;
    data['Currency*'] = this.currencyStar;
    data['Opening Stock Balance*'] = this.openingStockBalance;
    data['Sale Price +'] = this.salePrice;
    data['Sale Currency'] = this.saleCurrency;
    data['Sale GST'] = this.saleGst;
    data['Sale Inclusive GST'] = this.saleInclusiveGst;
    data['Buy Price +'] = this.buyPrice;
    data['Buy Currency'] = this.buyCurrency;
    data['Buy GST'] = this.buyGst;
    data['Buy Inclusive GST'] = this.buyInclusiveGst;
    data['line'] = this.line;
    data['default_currency_inventory_amount'] =
        this.default_currency_inventory_amount;
    return data;
  }
}
